<include file="Member:leftmenu" />
<script src="__STATIC__admin/js/laydate/laydate.js"></script>
<style>
  .wxtables td .btn {padding: 0px 6px;}
  #J_wx_fans{ vertical-align:-2px; margin-top:5px;}	
  .select.mini.new{ width:140px;}
  input.mini.Wdate{ width:100px;}
  </style>
<div class="content-right fl">

    <h1 class="content-right-title">会员列表<!--  <a
			class="gicon-info-sign gicon_linkother" href="http://#"
			target="_blank"></a>-->
	</h1>
    
    <div class="tablesWrap">
        <form action="" method="get" name="form1">
	  <!--   <div class="tables-searchbox">
	    
	   			 <input type="text" class="input mini" name="user_id" id="user_id" value="<?php echo get('user_id');?>" placeholder="用户ID">
                <input type="text" class="input mini" name="nickname" id="nickname" value="<?php echo get('nickname');?>" placeholder="姓名/微信昵称">
                <input type="hidden" name="p" value="1">
                <input type="text" class="input mini" name="mobile" value="<?php echo get('mobile');?>" placeholder="手机">

                
                <input type="text" name="start_create_time" id="start_create_time" value="<?php echo get('start_create_time');?>" placeholder="注册时间" class="input mini Wdate">
                <span class="mgr5">至</span>
                <input type="text" name="end_create_time" id="end_create_time" value="<?php echo get('end_create_time');?>" placeholder="注册时间" class="input mini Wdate">

                <button class="btn btn-primary" >
						<i class="gicon-search white"></i>查询</button>
                <a href="/admin/member/index" class="btn btn-warning">清除查询</a>
                <a class="btn btn-success J_export" target="_blank" href="javascript:excel();"><i class="gicon-share white"></i>导出</a> 
         </div> -->
	        <div>
	        
<script type="text/javascript">
function excel(){

	var res = "";
	var grade_id = $("#grade_id").val();
	var user_id = $("#user_id").val();
	var start_create_time = $("#start_create_time").val();
	var end_create_time = $("#end_create_time").val();

	var url_1 = "/admin/member/memberpage/?grade_id="+grade_id+"&user_id="+user_id+"&start_create_time="+start_create_time+"&end_create_time="+end_create_time;
	var url_2 = "/admin/member/memberexcel/?grade_id="+grade_id+"&user_id="+user_id+"&start_create_time="+start_create_time+"&end_create_time="+end_create_time;
	//查找页数
	$.ajax({
		url : url_1,
		type : "GET",
		dataType : 'json',
	//	async: false,
		success : function(data) {
			
			layer.closeAll('loading');//关闭正在加载
			if(data.ret == 0){
				// 成功
				var messagetype = 1;
			}else{
				// 失败
				var messagetype = 2;
			}

			layer.msg(data.msg, {icon: messagetype},function(){

				if(data.data==0){
					layer.msg("无数据", {icon: 2});
				}else if(data.data>0){

					var html = '<div style="padding:50px;">';
					for(i=1;i<=data.data;i++){

						var haha = url_2+"&p="+i;
						

						html += '<br><a href="'+haha+'" target="_blank" style="font-size:20px">下载'+i+'</a><br>';
						
						
					}
					
					html += '</div>';
					
					layer.open({
						title:"请分别点击下面的链接下载文件,每个文件最多包含5000条数据",
					    type: 1,
					    skin: 'layui-layer-rim', //加上边框
					    area: ['500px', '500px'], //宽高
					    content: html
					});
					
					
				}
				
			});
		},
		beforeSend:function(){
			layer.closeAll();//关闭
			layer.load();//正在加载
       },
       error: function() {
		   layer.closeAll('loading');//关闭正在加载
		   layer.msg("网络错误,请重试", {icon: 2});
       }
       
	});
	


	
	layer.closeAll();//关闭
}


</script>


            </div>
            </form>
	    </div>
	    <!-- end tables-searchbox -->
	    <table class="wxtables" style="margin-top:10px;">  
            <colgroup>  
                <col width="10%">
                <col width="7%">
                <col width="7%">
                <col width="7%">
                <col width="7%">
                <col width="6%">
            </colgroup>  
            <thead>
                <tr>  
                	<td>用户</td>
                	<td>信息</td>
                    <td>上级</td>
                    <td>佣金</td>
                    <td>账户</td>
                    <td>加入时间</td>
                </tr> 
            </thead>
            <tbody>
            
            <?php foreach($datalist as $k=>$v){ ?>
                <tr>
                	<!-- <td><input type="checkbox" class="checkbox table-ckbs" data-id="2418042"></td>-->
                	<td><a><img src="<?php echo $v['headimgurl'];?>" width="60" height="60"  onerror="javascript:this.src='__STATIC__/admin/images/error.png';" ></a>
                	<br>
                	<?php echo emoji_unified_to_html($v['nickname']);; ?><br>
                	<?=$v['realname']?>
                	<br>
                	 ID: <?php echo $v['uid'];?><br>
				     </td> 
				     <td>
                   		手机：<?php echo $v['mobile'];?><br>          	
			           	等级: <?php echo $v['grade_name'];?><br/> 
					</td>
				     <td>上级:<a><?php echo $v['refer_nickname'];?></a>
				     <br>
				                    上级ID: <?php echo $v['refer_uid'];?>
                    </td>
                    
                    <td>
					可用佣金:<a><?php echo $v['money'];?></a><br>
              		锁定佣金: <?php echo $v['lock_money'];?><br>
                    </td>
                    <td>
                	    已提现: <a ><?php echo $v['tixian'];?></a><br>
             		    电子币账户: <a><?php echo $v['cash_money'];?></a><br>
                    </td>
                   
                    <td><?php echo $v['create_time'];?></td>
                
				</tr>
			<?php } ?>

			</tbody>
        </table>
        
	<div class="tables-btmctrl clearfix">
           <div class="mgt10">
               <div class="paginate">
                  {$page}
               </div>
           </div>
	</div>
        
        
</div>
<script>
	var start = {
		elem : '#start_create_time',
		format : 'YYYY-MM-DD hh:mm:ss',
		min : '2015-11-01 00:00:00', //设定最小日期
		max : laydate.now(), //最大日期为当前日期
		istime : true,
		istoday : false,
		choose : function(datas) {
			end.min = datas; //开始日选好后，重置结束日的最小日期
			end.start = datas //将结束日的初始值设定为开始日
		}
	};
	var end = {
		elem : '#end_create_time',
		format : 'YYYY-MM-DD hh:mm:ss',
		min : '2015-11-01 00:00:00', //设定最小日期
		max : laydate.now(),
		istime : true,
		istoday : false,
		choose : function(datas) {
			start.max = datas; //结束日选好后，重置开始日的最大日期
		}
	};
	laydate(start);
	laydate(end);
</script>
